<template>
  <div>
    <h1>Count:{{ a }}</h1>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'Count',
});
</script>
<script lang="ts" setup>
import { ref } from 'vue';
const a = ref(1);

// defineExpose接收一个对象作为参数，对象内部书写哪些响应式数据允许其他组件通过当前组件实例获取
defineExpose({
  a,
});
</script>

<style lang="less" scoped></style>
